1. Field of the Invention
The present invention relates to a technique for system booting, and more particularly, to a method and apparatus for securely updating and boot code images.
2. Description of the Related Art
In general, in embedded systems, such as appliances, communication apparatuses, and setup boxes, nonvolatile storage devices have been widely used as storage mediums for storing and processing data. Further, the embedded system stores an operating system in the nonvolatile storage device, and is booted by the stored operating system to perform the operations. The operating system is primarily stored in the nonvolatile storage device in the form of images.
In order for a host to provide security, an operation system (OS) image recorded on a nonvolatile storage device by a vendor at the time of launch of a product is ensured to be booted with no change when the operating system is booted. For example, if the OS image and application programs are stored in a cellular phone, when the cellular phone is turned on and the OS image is loaded, a part of the OS image is changed by a cracker, and an execution logic is changed, which may cause the crash of security of a security module in the OS image. In this case, after the OS image is copied to a random access memory (RAM) and before a control is transferred, it is necessary to check whether or not the integrity of the OS image is preserved. Then, the control is transferred only when the integrity does not crash, such that the cracker does not change the OS image.
Presently, many vendors of the embedded systems need and provide methods of preserving the integrity of the OS image, but these methods are based on the fact that an algorithm for checking the integrity is under wraps, and keys in a CPU need to be stored in a tamper resistance module (TRM) region for protection. Accordingly, these methods are not perfect or a separate circuit needs to be provided. Further, a supporting method thereof may vary according to characteristics of the storage devices.
FIG. 1 is a diagram showing a secure booting apparatus for causing secure booting of an embedded system according to the related art.
The secure booting apparatus includes an operating system storage unit 10 that stores an operating system and a check value of an algorithm having a unique check value corresponding to the operating system, a memory unit 20, on which the operating system stored in the operating system storage unit 10 is loaded at the time of booting, and a control unit 30 that calculates a check value according to the loaded operating system through the algorithm used in storing the check value and judges integrity of the loaded operating system by comparing the stored check value and the calculated check value.
At this time, the operating system storage unit 10 has a nonvolatile storage region such that the stored operating system and check value are kept even though the power is turned off.
At the time of booting by the operating system, the secure booting apparatus further includes a boot code storage unit 40 that stores a boot code including information relative to a booting process, and a key storage unit 50 that encodes the operating system and the check value stored in the operating system storage unit 10 and stores keys for decoding the encoded operating system and check value. At this time, since the boot code storage unit 40 is in a read only mode, the boot code is not changed by any operation from the outside. In this case, as the algorithm used in calculating the check value, any algorithm can be used as long as it has a different check value, not the same check value, even though the operating system is changed by one bit.
The key storage unit 50 has a region, such as a TRM (Tamper Resistance Module) as a forgery protecting technique or the like, and protects the keys stored in the key storage unit 50 from external access. This is because the encoded operation system and check value stored in the operating system storage unit 10 may be changed when the keys stored in the key storage unit 50 are exposed to the outside. Further, the key storage unit 50 may be incorporated with a control unit 30 that controls the overall booting process or may be separately provided.
By the way, in many cases, the operating system needs to be continuously upgraded after the launch of the embedded system. In particular, products, such as a cellular phone, an MP3 player, and a PMP, need to rapidly adapt to environments by their characteristics. Accordingly, the installed operating system needs to be appropriately changed or upgraded later. In this case, when the keys are stored in the manner shown in FIG. 1, the change of the operating system by an unauthorized external access can be blocked, but the change of the operating system by an authorized vendor may also be blocked. However, when the change by the authorized person is permitted, an unauthorized change of the operating system may also be made. Therefore, there is a need for a countermeasure against the above-described problem.